X11: Fix the cut-off for too large windows
authorMatthias Clasen <mclasen@redhat.com>
Tue, 30 Jul 2013 00:51:39 +0000 (20:51 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 30 Jul 2013 00:51:39 +0000 (20:51 -0400)
We can only handle 2^15-1 pixels, not 2^16-1.
Pointed out by Morten Welinder.

https://bugzilla.gnome.org/show_bug.cgi?id=698758

gdk/x11/gdkwindow-x11.c

index 8eca50c61854e2c42380770fa7c800d372974e92..52f3642ddca8100b567e915e779ab6a4cc4dc3d9 100644 (file)
@@ -1085,15 +1085,15 @@ _gdk_x11_display_create_window_impl (GdkDisplay    *display,
       class = InputOnly;
     }
 
-  if (window->width * impl->window_scale > 65535 ||
-      window->height * impl->window_scale > 65535)
+  if (window->width * impl->window_scale > 32767 ||
+      window->height * impl->window_scale > 32767)
     {
-      g_warning ("Native Windows wider or taller than 65535 pixels are not supported");
+      g_warning ("Native Windows wider or taller than 32767 pixels are not supported");
 
-      if (window->width * impl->window_scale > 65535)
-        window->width = 65535 / impl->window_scale;
-      if (window->height  * impl->window_scale > 65535)
-        window->height = 65535 /  impl->window_scale;
+      if (window->width * impl->window_scale > 32767)
+        window->width = 32767 / impl->window_scale;
+      if (window->height  * impl->window_scale > 32767)
+        window->height = 32767 /  impl->window_scale;
     }
 
   impl->xid = XCreateWindow (xdisplay, xparent,